package com.ld.admin.service.system.dbbackup.impl;

import com.ld.admin.model.system.dbbackup.DbBackupSetModel;
import com.ld.admin.service.codegen.CodegenService;
import com.ld.admin.service.system.dbbackup.DbBackUpService;
import com.ld.shieldsb.common.core.util.SpringContextHolder;
import com.ld.shieldsb.db.model.DBSetInfo;

/**
 * 
 * 全库备份
 * 
 * @ClassName DbbackUpAllHandler
 * @author 刘金浩
 * @date 2019年11月19日 上午11:39:23
 *
 */
public class DbbackUpAllHandler implements DbBackUpHandler {

    @Override
    public void dbbackup(DbBackupSetModel backupSetModel) {

        CodegenService codegenService = SpringContextHolder.getBean(CodegenService.class);
        DbBackUpService dbBackUpService = SpringContextHolder.getBean(DbBackUpService.class);
        DBSetInfo dbSetInfo = codegenService.getDbSetInfo(backupSetModel.getDbConnId());
        dbBackUpService.mysqlBack(dbSetInfo, backupSetModel);
    }

}
